package com.woniu.service.sportsHealth.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.woniu.mapper.sportsHealth.SportMapper;
import com.woniu.model.sportsHealth.entity.Sport;
import com.woniu.model.sportsHealth.model.dto.SportDto;
import com.woniu.model.sportsHealth.model.vo.SportVo;
import com.woniu.service.sportsHealth.ISportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 运动表 服务实现类
 * </p>
 *
 * @author Jet
 * @since 2023-10-23
 */
@Service
public class SportServiceImpl extends ServiceImpl<SportMapper, Sport> implements ISportService {

    @Autowired
    SportMapper sportMapper;
    @Override
    public PageInfo<SportDto> findAll(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<SportDto> sportDtoList = sportMapper.findAll(param);
        PageInfo<SportDto> pageInfo = new PageInfo<>(sportDtoList);
        return pageInfo;
    }

    @Override
    public List<SportVo> findAllExport() {
        List<SportVo> export = sportMapper.findAllExport();
        return export;
    }
}
